package br.com.o2solutions.core.test.business.rule;

import org.springframework.stereotype.Component;

import br.com.o2solutions.core.exception.BusinessException;
import br.com.o2solutions.core.service.rule.Rule;
import br.com.o2solutions.core.test.model.ModelTest;
import br.com.o2solutions.util.assertion.Assert;

/**
 * @author osvaldeir
 * 
 */
@Component
public class RemoveRule implements Rule<ModelTest> {

	/*
	 * (non-Javadoc)
	 * 
	 * @see br.gov.mte.core.business.rule.Rule#check(java.lang.Object)
	 */
	@Override
	public void check(ModelTest entity) throws BusinessException {
		Assert.notNull(entity.getId(), new BusinessException(
				"O id para remocao nao pode ser nulo"));
	}

}
